Skip to content

Match only named lists in list grammar - #2784

Draft
datduyng wants to merge 7 commits into
mainfrom
domnguyen/list-placeholder-reject
Draft

Match only named lists in list grammar#2784
datduyng wants to merge 7 commits into
mainfrom
domnguyen/list-placeholder-reject

Conversation

@datduyng

@datduyng datduyng commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses review feedback (Robert): fix bare-reference capture by removing over-broad list grammar rules, not by teaching the list agent about placeholders/caching.

Grammar matches (named lists only)

  • add milk to the grocery list / add milk to my shopping list
  • can you add milk and eggs to the grocery list
  • put cheese on the grocery list, remove/get/clear with the same named shape

Grammar does not match → translation (LLM + history)

  • add ham to the list, put cheese on the list, add cheese to both, add ham to my list
  • Also determinerless add milk to grocery list (avoids reopening listName="the" via to $(listName) list)

Agent

  • Unchanged. No listName policing. create my list stays valid.

Tests

  • Unit match/no-match contract in listSchema.grammar.spec.ts
  • Dropped skipGrammar stopgaps on the two bare-list e2e phrases

Test plan

  • @typeagent/list-agent unit tests (23 passing)
  • Live translate-e2e / translate-history-e2e without skipGrammar

@robgruen

robgruen commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Looking at this I think a better approach is to just remove the grammar rule that's causing the problem.

If I say: "create a ingedients list and a shopping list" and then "add cheese to both" that should work. The agent shouldn't know or care about any grammar or caching. In fact, it should work regardless of language. A user should be able to create a list called "my"... or, my could refer to a list of the useres name but that should get resolved in translation and not in the agent.

@datduyng
datduyng marked this pull request as draft August 3, 2026 03:56
- Drop over-broad listSchema.agr rules that captured bare references
  ("the list", "my list", "both") as listName
- Keep named forms only ("the grocery list", "my shopping list") so
  translation resolves references from history or clarifies
- Remove skipGrammar stopgaps for those list phrases; update schema-tuning
  note #5

No agent-side placeholder rejection: list names like "my" stay valid;
reference resolution belongs in translation.
@datduyng
datduyng force-pushed the domnguyen/list-placeholder-reject branch from ef8841a to 56bb445 Compare August 3, 2026 04:10
@datduyng datduyng changed the title Reject placeholder list names from list grammar matches Match only named lists in list grammar Aug 3, 2026
typeagent-bot Bot and others added 6 commits August 3, 2026 04:12
Keep the list grammar fix; leave the guide note as on main.
- Keep bare/ambiguous refs unmatched so translation owns them (Robert)
- Add (can you)? on two-item adds; require everything|all items for clear
- Order ClearList before RemoveItems to avoid item="everything" steal
- Unit-test match/no-match matrix including create listName "my"
Follow Robert's guidance: remove over-broad grammar that captures bare
references; do not teach the list agent about placeholders.

- Named forms only: the|my + name + list (incl. can you two-item adds)
- Bare/ambiguous refs unmatched → translation (LLM + history)
- ClearList before RemoveItems; require everything|all items for clear
- Grammar contract unit tests; action-grammar test devDependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants